<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>文本插值</title>
    <style>
        .my{
            background-color: red;
            width: 100px;
            height: 50px;
        }
        .my1{
            background-color: yellow;
            width: 100px;
            height: 50px;
        }
    </style>
</head>
<body>

<div id="div">
    <a v-bind:href="url">百度一下</a>
    <br>
    <a :href="url">百度一下</a>
    <br>
    <div :class="cls">我是div</div>
    <!--支持三元运算符的写法-->
    <div :class="isborder?'my':'my1'">我是div</div>
</div>
<script src="js/vue.js"></script>
<script>
    new Vue({
        el:"#div",
        data:{
            url:"https://www.baidu.com",
            cls:"my",
            isborder:false
        }
    });
</script>
</body>
</html>